<template>
  <view class="container">
    <uni-nav-bar
      :border="false"
      statusBar
      title="营养成分"
      color="#000"
      left-icon="left"
      backgroundColor="transparent"
      @clickLeft="onBack"
    >
    </uni-nav-bar>

    <view class="box">
      <view class="infoBox">
        <view class="item">
          <text class="name">能量(kcal)</text>
          <text class="val">{{ query?.energy_kcal }}</text>
        </view>
        <view class="item">
          <text class="name">蛋白质(g)</text>
          <text class="val">{{ query?.protein }}</text>
        </view>
        <view class="item">
          <text class="name">脂肪(g)</text>
          <text class="val">{{ query?.fat }}</text>
        </view>
        <view class="item">
          <text class="name">碳水化合物(g)</text>
          <text class="val">{{ query?.cho }}</text>
        </view>
        <view class="item">
          <text class="name">钠(mg)</text>
          <text class="val">{{ query?.na }}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  components: {},
  data() {
    return {
      query: {},
      // 表单类型
      type: '',
    };
  },
  onLoad(query) {
    this.query = query;
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.container {
  min-height: calc(100vh - 160rpx);
  padding-bottom: calc(
    var(--window-bottom) + constant(safe-area-inset-bottom) + 160rpx
  );
  padding-bottom: calc(
    var(--window-bottom) + env(safe-area-inset-bottom) + 160rpx
  );
  background: linear-gradient(180deg, #d7e4fd 0%, #fff 50%);
  background-repeat: no-repeat;
  background-size: 100% auto;
  position: relative;
  .box {
    margin: 50rpx 36rpx 0;
    padding: 24rpx;
    background: #ffffff;
    border-radius: 12rpx;
    box-shadow: 0 0 30rpx 0 #ccc;
    .mainBox {
      text-align: center;
      padding: 40rpx 0;
      line-height: 1;

      .id {
        font-size: 38rpx;
        font-weight: bold;
        color: #4288ff;
        padding-bottom: 40rpx;
      }

      .val {
        font-size: 40rpx;
        font-weight: 800;
        color: #ff884d;
        padding-bottom: 27rpx;

        text {
          font-size: 30rpx;
          margin-left: 10rpx;
        }
      }

      .status {
        font-size: 26rpx;
        font-weight: 500;
        color: #555555;
      }
    }
    .infoBox {
      .item {
        font-size: 30rpx;
        font-weight: 500;
        padding: 22rpx 12rpx;
        display: flex;
        justify-content: space-between;
        border-bottom: 2rpx solid #eaeaea;
        &:last-child {
          border-bottom: 0;
        }
        .name {
          color: #989898;
        }

        .val {
          width: 60%;
          color: #333;
          text-align: right;
          word-break: break-all;
        }
      }
    }
  }
  .myLabel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    .star {
      color: #dd524d;
    }
  }
  .footer {
    display: flex;
    justify-content: space-evenly;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(
      var(--window-bottom) + constant(safe-area-inset-bottom) + 60rpx
    );
    bottom: calc(var(--window-bottom) + env(safe-area-inset-bottom) + 60rpx);
    .btn {
      width: 40%;
      margin: 0;
    }
  }
  .btnBox {
    margin: 60rpx 0 10rpx;
    .btn {
      background: linear-gradient(
          to bottom,
          #d5dee7 0%,
          #e8ebf2 50%,
          #e2e7ed 100%
        ),
        linear-gradient(
          to bottom,
          rgba(0, 0, 0, 0.02) 50%,
          rgba(255, 255, 255, 0.02) 61%,
          rgba(0, 0, 0, 0.02) 73%
        ),
        linear-gradient(
          33deg,
          rgba(255, 255, 255, 0.2) 0%,
          rgba(0, 0, 0, 0.2) 100%
        );
      background-blend-mode: normal, color-burn;
    }
  }
}
</style>
